//
//  MTMineHeadView.m
//  ShiShiBang
//
//  Created by 宋宝强 on 16/9/20.
//  Copyright © 2016年 motianjituan. All rights reserved.
//

#import "MTMineHeadView.h"

@interface MTMineHeadView ()

@property (nonatomic, weak)UIVisualEffectView *visualV;


@end
@implementation MTMineHeadView

+(instancetype)loadxib {
    return [[NSBundle mainBundle]loadNibNamed:@"MTMineHeadView" owner:nil options:nil].firstObject;
}


- (void)awakeFromNib {
    //创建需要的毛玻璃特效类型
    UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
    //创建毛玻璃视图
    UIVisualEffectView *visualV = [[UIVisualEffectView alloc] init];
    visualV.frame = self.imageView.bounds;
    self.visualV = visualV;
    //可以通过透明度来达到模糊程序的改变.
    visualV.effect = nil;
    [UIView animateWithDuration:0.01 animations:^{
        visualV.effect = blur;
    }];
    [self.imageView addSubview:visualV];
}

+ (instancetype)mineHeaderView {
    return [[NSBundle mainBundle] loadNibNamed:@"XQMineHeadView" owner:nil options:nil][0];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.visualV.frame = self.imageView.bounds;
}


@end
